import { $system } from '.';
import { useUserStore,useWebConfigStore } from '../stores';
import {$http} from './http';
export const getUserInfo = () => {
    const { setUserInfo } = useUserStore();
    $http.get("User/info").then((res: any) => {
        setUserInfo(res.data).then(() => {
        })
    }).catch(() => { })
}
export const getConfig=()=>{
    const {setWebConfig}=useWebConfigStore();
    $http.get('Config/index',{
        data:{
            platform:$system.platform()
        }
    }).then((res:any)=>{
        if(res.code===$http.ResponseCode.SUCCESS){
            setWebConfig(res.data);
        }
    }).catch(()=>{
    })
}